package com.aube.interact.fighter;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.util.AttributeSet;
import android.view.View;

/**
 * Created by hill on 10/24.
 */
public class HighlightAngleIndicator extends View {

    private Paint mPaint;

    public HighlightAngleIndicator(Context context) {
        this(context, null);
    }

    public HighlightAngleIndicator(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public HighlightAngleIndicator(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);

        mPaint = new Paint();
        mPaint.setAntiAlias(true);
        mPaint.setColor(0x66000000);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        int width = getWidth();
        int height = getHeight();

        Path path = new Path();
        path.moveTo(width/2 - height, 0);
        path.lineTo(width/2 + height, 0);
        path.lineTo(width/2, height);
        path.close();

        canvas.drawPath(path, mPaint);
    }
}
